package com.ziyucoding.flowable.approval.pojo;

import java.io.Serializable;

import lombok.Getter;
import lombok.Setter;

public class ResponseResult implements Serializable {

    private static final long serialVersionUID = 6783261606884469172L;

    public static final Integer SUCCESS_STATUS = 0;

    public static final String SUCCESS = "success";

    @Getter
    @Setter
    private Integer code;

    @Getter
    @Setter
    private String msg;

    @Getter
    @Setter
    private Object data;


    public static ResponseResult success(Object data) {
        return new ResponseResult(SUCCESS, SUCCESS_STATUS, data);
    }

    public static ResponseResult failed(Integer code, String message) {
        return new ResponseResult(message, code);
    }

    public ResponseResult(String message, Integer code) {
        this.msg = message;
        this.code = code;
    }

    public ResponseResult(String message, Integer code, Object data) {
        this.msg = message;
        this.code = code;
        this.data = data;
    }

}
